package tw.com.chttl;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.TableRow;
import android.view.ViewGroup.LayoutParams;

public class BabyPooPooActivity extends Activity{
	final int numButtons = 6;
	final String[] iconButtons = {"camera_trim", "note", "setting", "music", null, null}; 
	ImageButton [] imageButtons;
	
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
    	
        super.onCreate(savedInstanceState);                        
        setContentView(R.layout.baby_poopoo_layout);
                
        imageButtons = new ImageButton[numButtons];        
        
        LinearLayout linearLayout = (LinearLayout)findViewById(R.id.icon_layout);
        for(int i=0;i<numButtons;i++){
        	//the imageButton's size is set in onMeasure() of TimeLineView
        	ImageButton imageButton = new ImageButton(this);
        	imageButton.setAdjustViewBounds(true);
        	//imageButton.setPadding(5, 5, 5, 5);
        	//imageButton.setBackgroundColor(getResources().getColor(R.color.mainpage_background));
        	//imageButton.setBackgroundColor(Color.BLACK);
        	if(iconButtons[i] != null)
        		imageButton.setImageResource(getResources().getIdentifier("tw.com.chttl:drawable/"+iconButtons[i], null, null));
        	else{
        		imageButton.setEnabled(false);
        		imageButton.setVisibility(View.INVISIBLE);
        	}        	
        	
        	imageButtons[i] = imageButton;
        	linearLayout.addView(imageButtons[i]);
        }
        
        imageButtons[0].setOnClickListener(new OnClickListener(){
			public void onClick(View v) {
				Intent intent = new Intent(BabyPooPooActivity.this, TakePhotoActivity.class);
				BabyPooPooActivity.this.startActivity(intent);
			}
        });        
    }       
}